package com.baizhi.controller;


import com.baizhi.entity.CmfzBanner;
import com.baizhi.service.CmfzBannerService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * InnoDB free: 11264 kB 前端控制器
 * </p>
 *
 * @author xiaoxiao
 * @since 2020-08-19
 */
@RestController
@RequestMapping("/cmfz-banner")
public class CmfzBannerController {
    @Autowired
    private CmfzBannerService cmfzBannerService;
    @RequestMapping("selectAllByPage")
    public Map<String,Object> selectAllByPage(Integer page,Integer limit){
        Map<String,Object> map = new HashMap<>();
        PageInfo<CmfzBanner> pi = cmfzBannerService.selectAllByPage(page, limit);
        map.put("code",0);
        map.put("count",pi.getTotal());
        map.put("data",pi.getList());
        map.put("msg","green");
        return map;
    }
}
